@extends('layout') @section('content')
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 当前位置: <span class="c-gray en">&gt;</span>
	设置 <span class="c-gray en">&gt;</span> 支付设置
</nav>
<article class="page-container" id="pay_config">
	<form action="{{ url('nonPublicVersion/payConfig') }}" method="post"
		class="form form-horizontal" id="form-payconfig-edit">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"> <span class="c-red"></span>是否支持微信支付：
			</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="radio" name="wxpay" value="1" @if($info['wxpay'] ==
					1)
				checked
				@endif />&nbsp;是 &nbsp;&nbsp;&nbsp;&nbsp; <input type="radio"
					name="wxpay" value="0" @if($info['wxpay'] ==
					0)
				checked
				@endif />&nbsp;否
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"> <span class="c-red"></span>是否支持支付宝支付：
			</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="radio" name="alipay" value="1" @if($info['alipay'] ==
					1)
				checked
				@endif />&nbsp;是 &nbsp;&nbsp;&nbsp;&nbsp; <input type="radio"
					name="alipay" value="0" @if($info['alipay'] ==
					0)
				checked
				@endif />&nbsp;否
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<input class="btn btn-primary radius submit" type="button" value="修改">
			</div>
		</div>
	</form>
</article>
@endsection @section('script')
<script type="application/javascript">
$(".submit").on('click',function(){
    var url = $(this).attr('action');
    var wxpay = $(':radio[name="wxpay"]:checked').val();
    var alipay = $(':radio[name="alipay"]:checked').val();
    $.ajax({
        url:url,
        type:"post",
        data:{'wxpay':wxpay,'alipay':alipay},
        success:function(res)
        {
        if(res.code == 0){
      		 layer.msg(res.msg,{icon:1,time:1500});
      	 }else{
      		 layer.msg(res.msg,{icon:2,time:1500});
      	 }
        },
        error:function(e){
           layer.msg('未知错误！',{icon:3,time:1500});
        }
    });
});
</script>
@endsection
